package top.kaoshanji.p1ch06b;

/**
 * 代码清单-p1ch06b-129页a：复制了数组引用
 * author kaoshanji
 * ^_^
 * create time 2025/3/8 18:21
 */
public class ArraysOfPrimitives {

    public static void main(String[] args) {
        int[] a1 = {1, 2, 3, 4, 5};
        int[] a2;

        a2 = a1;

        for (int i = 0; i < a2.length; i++) {
            a2[i] += 1;
        }

        for (int i = 0; i < a1.length; i++) {
            System.out.println("a1[" + i + "] = " + a1[i]);
        }

    }


}
